package com.als.healthymananger.controller;


import com.als.healthymananger.entity.Report;
import com.als.healthymananger.utils.RespBean;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

@Tag(name = "健康评估-评估报告", description = "运动项目的增删改查")
public interface ReportsApi {
    /**
     * 添加报告
     */
    @PostMapping("/")
    @Operation(summary = "添加客户", description = "添加运动项目", security = @SecurityRequirement(name = "bearer-key"))
    @io.swagger.v3.oas.annotations.parameters.RequestBody(content = @Content(mediaType = "application/json;characterset=UTF-8", schema = @Schema(ref = "report")))
    @ApiResponses({
            @ApiResponse(responseCode = "200", description = "添加成功"),
            @ApiResponse(responseCode = "400", description = "添加失败"),
            @ApiResponse(responseCode = "401", description = "用户未登录"),
            @ApiResponse(responseCode = "403", description = "权限不足"),
            @ApiResponse(responseCode = "412", description = "先决条件不足，如数据格式不对")
    })
    public RespBean createReports(@RequestBody @Validated Report report);

    /**
     * 删除报告
     */
    @DeleteMapping("/{reportId}")
    @Operation(summary = "删除报告", description = "将报告enable项设置为否", security = @SecurityRequirement(name = "bearer-key"))
    @Parameter(name = "reportId", description = "报告序列", in = ParameterIn.PATH, required = true)
    @ApiResponses({
            @ApiResponse(responseCode = "200", description = "删除成功"),
            @ApiResponse(responseCode = "400", description = "删除失败"),
            @ApiResponse(responseCode = "401", description = "用户未登录"),
            @ApiResponse(responseCode = "403", description = "权限不足"),
            @ApiResponse(responseCode = "412", description = "先决条件不足，如数据格式不对")
    })
    public RespBean deleteReports(@PathVariable("reportId")int reportId);

    /**
     * 修改报告
     */
    @PutMapping("/{reportId}")
    @Operation(summary = "修改报告", description = "修改报告", security = @SecurityRequirement(name = "bearer-key"))
    @Parameters({
            @Parameter(name = "reportId", description = "报告序列", in = ParameterIn.PATH, required = true),
    })
    @io.swagger.v3.oas.annotations.parameters.RequestBody(content = @Content(mediaType = "application/json;characterset=UTF-8", schema = @Schema(ref = "report")))
    @ApiResponses({
            @ApiResponse(responseCode = "200", description = "修改成功"),
            @ApiResponse(responseCode = "400", description = "修改失败"),
            @ApiResponse(responseCode = "401", description = "用户未登录"),
            @ApiResponse(responseCode = "403", description = "权限不足"),
            @ApiResponse(responseCode = "412", description = "先决条件不足，如数据格式不对")
    })
    public RespBean updateReports(@PathVariable("reportId")int reportId,
                                   @RequestBody @Validated Report report);

    /**
     * 获取报告信息
     */
    @GetMapping("/{reportId}")
    @Operation(summary = "获取报告信息", description = "获取报告信息", security = @SecurityRequirement(name = "bearer-key"))
    @Parameter(name = "reportId", description = "报告序列", in = ParameterIn.PATH, required = true)
    @ApiResponses({
            @ApiResponse(responseCode = "200", description = "获取成功"),
            @ApiResponse(responseCode = "400", description = "获取失败"),
            @ApiResponse(responseCode = "401", description = "用户未登录"),
            @ApiResponse(responseCode = "403", description = "权限不足"),
            @ApiResponse(responseCode = "412", description = "先决条件不足，如数据格式不对")
    })
    public RespBean getReportss(@PathVariable("reportId")int reportId);
}
